package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.TbCpadSaleMapper;
import com.ruoyi.business.domain.TbCpadSale;
import com.ruoyi.business.service.ITbCpadSaleService;

/**
 * 业务员信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-17
 */
@Service
public class TbCpadSaleServiceImpl implements ITbCpadSaleService 
{
    @Autowired
    private TbCpadSaleMapper tbCpadSaleMapper;

    /**
     * 查询业务员信息
     * 
     * @param id 业务员信息主键
     * @return 业务员信息
     */
    @Override
    public TbCpadSale selectTbCpadSaleById(Long id)
    {
        return tbCpadSaleMapper.selectTbCpadSaleById(id);
    }

    /**
     * 查询业务员信息列表
     * 
     * @param tbCpadSale 业务员信息
     * @return 业务员信息
     */
    @Override
    public List<TbCpadSale> selectTbCpadSaleList(TbCpadSale tbCpadSale)
    {
        return tbCpadSaleMapper.selectTbCpadSaleList(tbCpadSale);
    }

    /**
     * 新增业务员信息
     * 
     * @param tbCpadSale 业务员信息
     * @return 结果
     */
    @Override
    public int insertTbCpadSale(TbCpadSale tbCpadSale)
    {
        tbCpadSale.setCreateTime(DateUtils.getNowDate());
        return tbCpadSaleMapper.insertTbCpadSale(tbCpadSale);
    }

    /**
     * 修改业务员信息
     * 
     * @param tbCpadSale 业务员信息
     * @return 结果
     */
    @Override
    public int updateTbCpadSale(TbCpadSale tbCpadSale)
    {
        tbCpadSale.setUpdateTime(DateUtils.getNowDate());
        return tbCpadSaleMapper.updateTbCpadSale(tbCpadSale);
    }

    /**
     * 批量删除业务员信息
     * 
     * @param ids 需要删除的业务员信息主键
     * @return 结果
     */
    @Override
    public int deleteTbCpadSaleByIds(Long[] ids)
    {
        return tbCpadSaleMapper.deleteTbCpadSaleByIds(ids);
    }

    /**
     * 删除业务员信息信息
     * 
     * @param id 业务员信息主键
     * @return 结果
     */
    @Override
    public int deleteTbCpadSaleById(Long id)
    {
        return tbCpadSaleMapper.deleteTbCpadSaleById(id);
    }
}
